import request from '@/utils/request_zc'

export function getProductScheduleList ({
  serialNo,
  planNo,
  materialName,
  bom,
  productLine,
  process,
  project,
  productStartDate,
  productEndDate,
  productAttr,
  deliveryStartDate,
  deliveryEndDate,
  deliveryAttr,
  publishStatus,
  page, limit }) {
  return request({
    url: '/mes/product/schedule/list',
    method: 'get',
    params: {
      serialNo,
      planNo,
      materialName,
      bom,
      productLine,
      process,
      project,
      productStartDate,
      productEndDate,
      productAttr,
      deliveryStartDate,
      deliveryEndDate,
      deliveryAttr,
      publishStatus,
      page,
      limit
    }
  })
}


export function editProductSchedule ({
  bom,
  deliveryDate,
  detailList,
  finishedQuantity,
  id,
  issueStatus,
  model,
  planNo,
  process,
  product,
  productDate,
  productLine,
  project,
  publishStatus,
  remark,
  serialNo,
  specification,
  unfinishedQuantity,
  unit,
}) {
  return request({
    url: '/mes/product/schedule/edit',
    method: 'post',
    data: {
      bom,
      deliveryDate,
      detailList,
      finishedQuantity,
      id,
      issueStatus,
      model,
      planNo,
      process,
      product,
      productDate,
      productLine,
      project,
      publishStatus,
      remark,
      serialNo,
      specification,
      unfinishedQuantity,
      unit,
    }
  })
}

export function addProductSchedule ({
  bom,
  deliveryDate,
  detailList,
  finishedQuantity,
  issueStatus,
  model,
  planNo,
  process,
  product,
  productDate,
  productLine,
  project,
  publishStatus,
  remark,
  serialNo,
  specification,
  unfinishedQuantity,
  unit,
}) {
  return request({
    url: '/mes/product/schedule/add',
    method: 'post',
    data: {
      bom,
      deliveryDate,
      detailList,
      finishedQuantity,
      issueStatus,
      model,
      planNo,
      process,
      product,
      productDate,
      productLine,
      project,
      publishStatus,
      remark,
      serialNo,
      specification,
      unfinishedQuantity,
      unit,
    }
  })
}

export function getProductScheduleDetailList ({ id }) {
  return request({
    url: `/mes/product/schedule/detail/${id}`,
    method: 'get',
  })
}
